package com.example.controller;

import com.example.pojo.JobOption;
import com.example.pojo.Result;
import com.example.service.ReportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    private static final Logger log = LoggerFactory.getLogger(EmpController.class);
//    统计员工职业人数
    @GetMapping("empJobData")
    public Result getEmpJobData(){
        log.info("统计员工职业人数");
        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }
    //    统计员工性别人数
    @GetMapping("empGenderData")
    public Result getEmpGenderData(){
        log.info("统计员工性别人数");
        List<Map> genderList = reportService.getEmpGenderData();
        return Result.success(genderList);
    }
}
